'''
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License") you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http:#www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
'''


'''
 * The interface for visiting (ie type-dispatching) an RDF Node.
'''
from abc import ABC, abstractmethod

class RDFVisitor(ABC):
    '''
     * Method to call when visiting a blank node r with identifier id.
     *
     * @param r  the blank RDF node being visited
     * @param id the identifier of that node
     * @return value to be returned from the visit
    '''
    # param Resource r, AnonId id
    # result Object
    @abstractmethod
    def visitBlank(self, r, id):
        pass

    '''
     * Method to call when visiting a URI node r with the given uri.
     *
     * @param r   the URI node being visited
     * @param uri the URI string of that node
     * @return value to be returned from the visit
    '''
    # param Resource r, String uri
    # result Object
    @abstractmethod
    def visitURI(self, r, uri):
        pass


    '''
     * Method to call when visiting a resource with a statement.
     *
     * @param r         the resource node being visited
     * @param statement the statement of that node
     * @return value to be returned from the visit
    '''

    # param Resource r, Statement statement
    # result default Object
    # @abstractmethod
    def visitStmt(self, r, statement):
        return None
    

    '''
     * Method to call when visiting a literal RDF node l.
     *
     * @param l the RDF Literal node
     * @return a value to be returned from the visit
    '''
    # param Literal l
    # result Object
    @abstractmethod
    def visitLiteral(self, l):
        pass

